package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.util.Internal;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据用户的openid来查找用户信息，判断是否有该用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    void insert(User user);
    /**
     * 根据id来查询用户
     * @param id
     * @return
     */
    @Select("select * from user where id = #{id}")
    User getById(Long id);

    /**
     * 根据时间动态统计相应用户数量
     * @return
     */
    Integer countByMap(Map map);
}
